home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / fractal / kaos.lha / tserlib / create_tser_windows.c next >
Encoding:
C/C++ Source or Header  |  1990-01-22  |  3.7 KB  |  120 lines

  1. /*
  2. ### create a tser window ###
  3. */
  4.  
  5. #include <suntool/sunview.h>
  6. #include <suntool/panel.h>
  7.  
  8. void create_tser_windows()
  9. {
  10.     void tser_quit_proc(),tser_copy_proc(),tser_clear_proc();
  11.     void tser_fft_proc(),tser_lyap_proc(),tser_dims_proc();
  12.     void tser_algorithm_option_proc(),tser_data_option_proc();
  13.     int i,ipanel_row=0,px,py;
  14.     extern Frame frame,tser_frame;
  15.     extern Panel tser_panel;
  16.     extern Pixfont *boldfont;
  17.     extern Panel_item tser_quit_item,tser_copy_item,tser_clear_item;
  18.     extern Panel_item tser_fft_item,tser_lyap_item,tser_dims_item;
  19.     extern Panel_item tser_data_option_item,tser_algorithm_option_item;
  20.     extern short tser_panel_show;
  21.     extern int panel_colormap_on;
  22.     extern int tser_data_option,tser_algorithm_option;
  23.     extern char string[];
  24.     
  25.     /* Turn on the flag */    
  26.     if(tser_panel_show){
  27.         window_set(tser_frame,WIN_SHOW,TRUE,0);    
  28.         return;
  29.     }
  30.     else
  31.         tser_panel_show = 1;
  32.  
  33.     px = (int) window_get(frame,WIN_X) + (int) window_get(frame,WIN_WIDTH)/2;
  34.     py = (int) window_get(frame,WIN_Y) + (int) window_get(frame,WIN_HEIGHT) /2;
  35.     /* Create tser frame */
  36.     tser_frame = window_create(frame,FRAME,
  37.         FRAME_NO_CONFIRM,       TRUE,
  38.         FRAME_LABEL,    "time series",
  39.         FRAME_SHOW_LABEL,       TRUE,
  40.         WIN_SHOW,       TRUE,
  41.         WIN_X,  px,
  42.         WIN_Y,  py,
  43.         WIN_FONT, boldfont,
  44.         0);
  45.     if(tser_frame == NULL) {
  46.         system_mess_proc(1,"No more windows. Clean up some windows to make room.");
  47.         tser_panel_show = 0;
  48.         return;
  49.     }
  50.     /* Create Panel */
  51.     tser_panel = window_create(tser_frame, PANEL,
  52.         WIN_X, 0,
  53.         WIN_Y, 0,
  54.         WIN_FONT, boldfont,
  55.         0);
  56.     if(tser_panel == NULL) {
  57.         system_mess_proc(1,"No more windows. Clean up some windows to make room.");
  58.         (void) destroy_tser_windows();
  59.         return;
  60.     }
  61.     /* Create panel items */
  62.     tser_quit_item= panel_create_item(tser_panel, PANEL_BUTTON,
  63.         PANEL_LABEL_Y, ATTR_ROW(ipanel_row++),
  64.         PANEL_LABEL_X, ATTR_COL(0),
  65.         PANEL_LABEL_IMAGE, panel_button_image(tser_panel, "Quit", 5, boldfont),
  66.         PANEL_NOTIFY_PROC, tser_quit_proc,
  67.         0);
  68.     tser_copy_item= panel_create_item(tser_panel, PANEL_BUTTON,
  69.         PANEL_LABEL_IMAGE, panel_button_image(tser_panel, "Copy", 5, boldfont),
  70.         PANEL_NOTIFY_PROC, tser_copy_proc,
  71.         0);
  72.     tser_clear_item= panel_create_item(tser_panel, PANEL_BUTTON,
  73.         PANEL_LABEL_IMAGE, panel_button_image(tser_panel, "Clear", 5, boldfont),
  74.         PANEL_NOTIFY_PROC, tser_clear_proc,
  75.         0);
  76.     tser_fft_item= panel_create_item(tser_panel, PANEL_BUTTON,
  77.         PANEL_LABEL_IMAGE, panel_button_image(tser_panel, "Four", 5, boldfont),
  78.         PANEL_NOTIFY_PROC, tser_fft_proc,
  79.         0);
  80.     tser_lyap_item= panel_create_item(tser_panel, PANEL_BUTTON,
  81.         PANEL_LABEL_IMAGE, panel_button_image(tser_panel, "Lyap", 5, boldfont),
  82.         PANEL_NOTIFY_PROC, tser_lyap_proc,
  83.         0);
  84.     tser_dims_item= panel_create_item(tser_panel, PANEL_BUTTON,
  85.         PANEL_LABEL_IMAGE, panel_button_image(tser_panel, "Dims", 5, boldfont),
  86.         PANEL_NOTIFY_PROC, tser_dims_proc,
  87.         0);
  88.     tser_data_option_item= panel_create_item(tser_panel, PANEL_CYCLE,
  89.         PANEL_LABEL_Y, ATTR_ROW(ipanel_row++),
  90.         PANEL_LABEL_X, ATTR_COL(0),
  91.         PANEL_DISPLAY_LEVEL, PANEL_CURRENT,
  92.         PANEL_LABEL_STRING, "Input Data: ",
  93.         PANEL_CHOICE_STRINGS,
  94.             "From current orbit data",
  95.             "From copied time series",
  96.             0,
  97.         PANEL_VALUE, tser_data_option,
  98.         PANEL_NOTIFY_PROC, tser_data_option_proc,
  99.         0);
  100.     tser_algorithm_option_item= panel_create_item(tser_panel, PANEL_CYCLE,
  101.         PANEL_LABEL_Y, ATTR_ROW(ipanel_row++),
  102.         PANEL_LABEL_X, ATTR_COL(0),
  103.         PANEL_DISPLAY_LEVEL, PANEL_CURRENT,
  104.         PANEL_LABEL_STRING, "Algorithm: ",
  105.         PANEL_CHOICE_STRINGS,
  106.             "Sum of all components",
  107.             "Sum of squares of all components",
  108.             "A Component",
  109.             0,
  110.         PANEL_VALUE, tser_algorithm_option,
  111.         PANEL_NOTIFY_PROC, tser_algorithm_option_proc,
  112.         0);
  113.  
  114.     window_fit(tser_panel);
  115.     window_fit(tser_frame);
  116.  
  117.     if(panel_colormap_on)
  118.         init_panel_colormap((Pixwin *) window_get(tser_panel,WIN_PIXWIN),"tser_panel_cms");
  119. }
  120.